package JavaDesign.report_2.t_2;

/**
 * @author zouran
 * createDate：2023/9/27  1:41
 */
public class Sale {
    public static void main(String[] args) {
        ComputeTotalSales[] goods = new ComputeTotalSales[40];
        for (int i = 0; i < goods.length; i++) {
            if (i % 3 == 0) { //商品Television初始化
                goods[i] = new Television();
            } else if (i % 3 == 1) {//商品Computer初始化
                goods[i] = new Computer();
            } else {//商品Mobile初始化
                goods[i] = new Mobile();
            }
        }
        Shop shop = new Shop(goods);
        System.out.println("所有商品的年销售额为:" + shop.giveTotalSales());
    }

}
